package com.fudan.es.aggs.request.handler.metric;

import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.springframework.stereotype.Component;

import com.fudan.es.Aggs;
import com.fudan.es.entity.FieldMeta;
import com.fudan.es.entity.MetricPack;

public class AvgHandler extends MetricHandler{

	@Override
	public AggregationBuilder build(MetricPack metric) {
		FieldMeta field = metric.getField();
		return Aggs.avg(field);
	}
}
